home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_item_submachine.cog < prev    next >
Text File  |  1999-11-15  |  1KB  |  91 lines

  1. # Jones 3D Cog Script
  2. #
  3. # item_Submachine.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message    activated
  14. message    touched
  15. message    taken
  16.  
  17. sound    foundSnd=INXJ159.wav    local
  18.  
  19. thing    player                    local
  20.  
  21. int        bin=8                    local
  22. int        bFound=0                local
  23. int        amount=20                local
  24.  
  25. int        bUnderwater                local
  26.  
  27. end
  28.  
  29. # ===================================================================
  30.  
  31. code
  32.  
  33. activated:
  34.  
  35.     player = GetSourceRef();
  36.  
  37.     StartCutscene(0);
  38.  
  39.     if (Rand() < 0.5)
  40.     {
  41.         SetExtCamOffset('0.15 -0.05 0.04');
  42.     }
  43.     else
  44.     {
  45.         SetExtCamOffset('-0.15 -0.05 0.04');
  46.     }
  47.     SetExtCamLookOffset('0.0 0.02 -0.01');
  48.  
  49.     return;
  50.  
  51. # -------------------------------------------------------------------
  52.  
  53. touched:
  54.  
  55.     player = GetSourceRef();
  56.  
  57.     if (GetInv(player, bin) < GetInvMax(player, bin))
  58.     {
  59.         TakeItem(GetSenderRef(), player);
  60.     }
  61.     else
  62.     {
  63.         EndCutscene();
  64.     }
  65.     
  66.     return;
  67.  
  68. # -------------------------------------------------------------------
  69.  
  70. taken:
  71.  
  72.     player = GetSourceRef();
  73.     bFound = IsItemFound(bin);
  74.     bUnderwater = BitTest(GetThingFlags(player), 0x02000000);
  75.  
  76.     JonesInvItemChanged(bin);
  77.     ChangeInv(player, bin, amount);
  78.     SetInvAvailable(player, bin, 1);
  79.  
  80.     if (!bFound && !bUnderwater)
  81.     {
  82.         Sleep(1.0);
  83.         PlayVoice(player, foundSnd, 1.0, 0);
  84.     }
  85.  
  86.     EndCutscene();
  87.  
  88.     return;
  89.  
  90. end
  91.